package com.ruoyi.suggestion.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.suggestion.mapper.CommunityCommentMapper;
import com.ruoyi.suggestion.domain.CommunityComment;
import com.ruoyi.suggestion.service.ICommunityCommentService;

/**
 * 建议评论Service业务层处理
 * 
 * @author xianyu
 * @date 2025-04-03
 */
@Service
public class CommunityCommentServiceImpl implements ICommunityCommentService 
{
    @Autowired
    private CommunityCommentMapper communityCommentMapper;

    /**
     * 查询建议评论
     * 
     * @param id 建议评论主键
     * @return 建议评论
     */
    @Override
    public CommunityComment selectCommunityCommentById(Long id)
    {
        return communityCommentMapper.selectCommunityCommentById(id);
    }

    /**
     * 查询建议评论列表
     * 
     * @param communityComment 建议评论
     * @return 建议评论
     */
    @Override
    public List<CommunityComment> selectCommunityCommentList(CommunityComment communityComment)
    {
        return communityCommentMapper.selectCommunityCommentList(communityComment);
    }

    /**
     * 新增建议评论
     * 
     * @param communityComment 建议评论
     * @return 结果
     */
    @Override
    public int insertCommunityComment(CommunityComment communityComment)
    {
        communityComment.setCreateTime(DateUtils.getNowDate());
        return communityCommentMapper.insertCommunityComment(communityComment);
    }

    /**
     * 修改建议评论
     * 
     * @param communityComment 建议评论
     * @return 结果
     */
    @Override
    public int updateCommunityComment(CommunityComment communityComment)
    {
        return communityCommentMapper.updateCommunityComment(communityComment);
    }

    /**
     * 批量删除建议评论
     * 
     * @param ids 需要删除的建议评论主键
     * @return 结果
     */
    @Override
    public int deleteCommunityCommentByIds(Long[] ids)
    {
        return communityCommentMapper.deleteCommunityCommentByIds(ids);
    }

    /**
     * 删除建议评论信息
     * 
     * @param id 建议评论主键
     * @return 结果
     */
    @Override
    public int deleteCommunityCommentById(Long id)
    {
        return communityCommentMapper.deleteCommunityCommentById(id);
    }
}
